Skip to content

feat(aggregator): expand + zoom/pan controls on every /aa chart (#3298) - #4154

Merged
dezren39 merged 2 commits into
mainfrom
queue/4886-3298-aa-chart-zoom
Nov 2, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/4886-3298-aa-chart-zoom

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements #3298 (Drew's order, queue task 4886): every chart on the aggregator /aa page gets an expand button and zoom/pan controls.

What landed

  • All six explorer charts (xpl-c1..c6: frontier scatters, multiples, scores) carry server-rendered ⤢ Expand / + / − / ⟲ buttons next to their existing per-chart controls.
  • Band scatters (built client-side by renderRecs / renderBandComparisons) get the identical tool set injected by the enhancer, so no rendered chart on /aa is left without controls.
  • Zoom/pan model: pure SVG viewBox manipulation — zoom buttons (center), mouse-wheel zoom at the pointer, and drag-to-pan while zoomed. State is per chart and survives redraws; a draw that resets a chart's viewBox (scores chart height) retires stale zoom instead of misapplying it. Drag-pan suppresses the click it would otherwise fire, so point selection behavior is unchanged. Reset restores the drawn view.
  • Expand: the chart card becomes a fixed, near-full-viewport overlay; Esc or the Close button exits.
  • Parity: filters, perspective switcher, tabs, and data rendering are untouched. One deliberate behavior note: PNG download exports the currently visible region, so a zoomed chart downloads its zoomed crop.

Tests

Remaining acceptance step

Live verification on https://amd-6.raptor-pumpkinseed.ts.net/aa follows the normal deploy from the laptop primary clone after merge; task 4886 tracks it.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

- Six explorer charts (xpl-c1..c6) get server-rendered Expand / zoom-in / zoom-out / reset buttons beside their existing controls
- Band scatters built client-side (renderRecs / renderBandComparisons) get the same tools injected by the enhancer, so no chart on /aa is left without them
- Zoom/pan is pure viewBox manipulation (buttons, wheel-at-pointer, drag-pan while zoomed) with per-chart state tracked across redraws; a draw that resets the viewBox drops stale zoom instead of misapplying it
- Expand toggles a fixed overlay on the chart card; Esc or the Close button exits; drag-pan suppresses the click it would otherwise fire on chart points
- Filters, perspective switcher, downloads and data rendering unchanged; PNG export now reflects the visible (possibly zoomed) region
- Tests: tool set present for all six charts; enhancer ships for dynamic charts and the emitted script still parses
@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 03:22
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b2775bcc-f2a1-46d2-ba00-bd3e29f7f483
Commits

Reviewing files that changed from the base of the PR and between ac77716 and 88920b4.

Files selected for processing: 2
  • pm-stack/aggregator/src/render.ts
  • pm-stack/aggregator/test/aa.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T03:35:23.365316Z 88920b4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b61ea61d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/aggregator/src/render.ts Resolved
Comment thread pm-stack/aggregator/src/render.ts Resolved
Comment thread pm-stack/aggregator/src/render.ts Resolved
- P1: defer pointer capture until a pan gesture is actually detected, so ordinary clicks still reach point/bar selection handlers
- P2: renderRecs re-runs enhanceCharts() after its own redraws, so recommendation-input changes no longer strip band-chart controls
- P2: bare band scatters in the shared #xpl-recs/#xpl-bandgroups containers get a dedicated .chart-mini wrapper, so Expand isolates one chart

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88920b4a06

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +4052 to +4054
svg.addEventListener("pointermove", function (e) {
if (!drag) return;
var dx = e.clientX - drag.lx, dy = e.clientY - drag.ly;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clear pending drags when the pointer is released outside the SVG

On a zoomed chart, pressing near its edge, leaving before pointer capture starts, and releasing outside leaves drag populated because the SVG never receives pointerup. Moving back over the chart then pans it without any button pressed: this handler treats the stale drag as active, and the failed capture is silently swallowed. Clear pending drags on outside release/cancellation, or check e.buttons before continuing a mouse drag.

Useful? React with 👍 / 👎.

Comment on lines +3978 to +3981
var r = svg.getBoundingClientRect();
if (!r.width || !r.height) return;
st.cur[0] -= dx * st.cur[2] / r.width;
st.cur[1] -= dy * st.cur[3] / r.height;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Transform pointer coordinates using the rendered SVG scale

When an expanded chart hits the new CSS max-height limit on a wide viewport, its SVG element remains full-width but the viewBox is rendered with horizontal letterboxing. Dividing by the element's bounding-box width therefore understates horizontal pan distances; the wheel handler's bounding-box fractions likewise zoom toward the wrong position instead of the point under the cursor. Convert pointer positions and deltas through the SVG screen transformation matrix, or account for the actual rendered viewBox rectangle, so expanded charts track the pointer correctly.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant